package com.shdanyan.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.shdanyan.domain.sys.PermissionInfo;
import com.shdanyan.utils.MyMapper;

@Mapper
public interface PermissionInfoMapper extends MyMapper<PermissionInfo> {

    @Select(" SELECT                                                   "
            + "     p.*, r.name as role_name                           "
            + " FROM                                                   "
            + "     sys_permission_info p                              "
            + "         LEFT JOIN                                      "
            + "     link_permission_role pr ON p.id = pr.permission_id "
            + "         LEFT JOIN                                      "
            + "     sys_role_info r ON pr.role_id = r.id               ")
    List<PermissionInfo> getPermissionRole();

}